package com.zbkj.service.config;

import com.zbkj.common.utils.RedisUtil;
import com.zbkj.service.service.BrandService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;

/**
 * 品牌商配置
 */
@Configuration
@Slf4j
public class BrandConfig {

    @Autowired
    private BrandService brandService;

    @Autowired
    private RedisUtil redisUtil;

    @EventListener(ApplicationReadyEvent.class)
    public void start() {
        // 缓存品牌商信息
        log.info("缓存品牌商信息");
        brandService.cacheBrandInfo();
    }
}
